import { ApiProperty } from '@nestjs/swagger';
import { IsString, IsNumber, IsOptional, IsBoolean, Min } from 'class-validator';

/**
 * 创建会员套餐DTO
 */
export class CreateMembershipPackageDto {
  @ApiProperty({ description: '套餐名称', example: 'VIP月卡' })
  @IsString()
  name: string;

  @ApiProperty({ description: '套餐价格（单位：分）', example: 3000 })
  @IsNumber()
  @Min(1)
  price: number;

  @ApiProperty({ description: '套餐时长（天数）', example: 30 })
  @IsNumber()
  @Min(1)
  durationDays: number;

  @ApiProperty({ description: '套餐等级', example: 1, required: false })
  @IsOptional()
  @IsNumber()
  @Min(1)
  level?: number;

  @ApiProperty({ description: '套餐描述', example: '享受VIP专属服务', required: false })
  @IsOptional()
  @IsString()
  description?: string;

  @ApiProperty({ description: '是否启用', example: true, required: false })
  @IsOptional()
  @IsBoolean()
  isActive?: boolean;
}